﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ManagerVerification.Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script type="text/javascript">

        $(document).ready(function () {
            $('#SHCode').live('change', function () { SHCheck($(this)); });
            $('#CloseImagePanel').live('click', function () { $('#ImageDiv').hide(); });

            $('tr[where="wares"]').live('click', function () { ViewMap($(this)); });
            $('#closeWareMap').live('click', function () { hideWareMap(); });
            $('#ChangeLinkButton').live('click', function () { changeWare($(this)); });

            $('#wares_wareimage').live('click', function () { viewImage(); });

            $('#ImageDiv').hide();
        });

        function viewImage() {
            var shcode = $('#wares_shcode').text();
            var img = '/Cash/' + shcode + '.png';
            $('#Image1').attr('src', img);

            $.ajax({
                url: img,
                type: 'HEAD',
                error:
                function () {
                    $('#NoImageLabel').css('visibility', 'visible');
                },
                success:
                function () {
                    $('#NoImageLabel').css('visibility', 'hidden');
                }
            });

            $.post(document.URL,
                { client: "wares",
                    method: "view_image",
                    shcode: shcode
                });

            $('#ImageDiv').show();
        };

        function changeWare(element) {

            var wareid = $('#WareMap').attr('wareid');

            $.post(document.URL,
                { client: "wares",
                    method: "change_ware",
                    wareid: wareid
                }, function () { $('#WareMap').css('visibility', 'hidden'); });
        };

        function ViewAddPanel(wareid) {
            $('#WareMap').css('visibility', 'hidden');
            var offs0 = $('tr[wareid="' + wareid + '"]').offset();
            $('#AddWarePanel').css("position", "absolute");
            $('#AddWarePanel').css("left", '650px');
            $('#AddWarePanel').css("top", offs0.top);
        };

        function hideWareMap() {
            $('#WareMap').css('visibility', 'hidden');
            $('tr[where="wares"]').css('background', 'silver');
        };

        function ViewMap(element) {
            var element = $(element);
            $('#WareMap').css('visibility', 'visible');
            $('#WareMap').show();
            $('#WareMap').attr('wareid', element.attr('wareid'));
            $('tr[where="wares"]').css('background', 'silver');
            element.css('background', 'orange');
            var container = $(element);

            var wareid = container.attr('wareid');
            var ispiece = container.attr('ispiece');
            var warename = container.attr('wareattr_warename');
            var shortdesc = container.attr('wareattr_shortdesc');
            var fulldesc = container.attr('wareattr_fulldesc');
            var shcode = container.attr('wareattr_shcode');
            var pricemain = container.attr('wareattr_pricemain');
            var pricecategory = container.attr('wareattr_pricecategory');
            var producer = container.attr('wareattr_producer');
            var country = container.attr('wareattr_country');
            var warecategory = container.attr('wareattr_warecategory');
            var counter = container.attr('wareattr_counter');
            var rating = container.attr('wareattr_rating');
            var shopid = container.attr('wareattr_shopid');
            var shop = container.attr('wareattr_shop');
            var article = container.attr('wareattr_article');
            var liveid = container.attr('wareattr_liveid');
            var pricered = container.attr('wareattr_pricered');
            var groupid = container.attr('wareattr_groupid');
            var nettoweight = container.attr('wareattr_nettoweight');
            var bruttoweight = container.attr('wareattr_bruttoweight');
            var recipe = container.attr('wareattr_recipe');
            var staff = container.attr('wareattr_staff');
            var stafflistguid = container.attr('wareattr_stafflistguid');
            var validbefore = container.attr('wareattr_validbefore');
            var conditions = container.attr('wareattr_conditions');
            var protein = container.attr('wareattr_protein');
            var fat = container.attr('wareattr_fat');
            var carbonhydrates = container.attr('wareattr_carbonhydrates');
            var energyvalue = container.attr('wareattr_energyvalue');
            var lightvalue = container.attr('wareattr_lightvalue');
            var dateupdateprice = container.attr('wareattr_dateupdateprice');

            $('#WareCart').attr('wareid', wareid);
            $('#wares_warename').text(warename);
            $('#wares_shcode').text(shcode);
            $('#wares_article').text(article);
            $('#wares_shortdesc').text(shortdesc);
            $('#wares_fulldesc').text(fulldesc);
            $('#wares_pricemain').text(pricemain);
            $('#wares_pricered').text(pricered);
            $('#wares_producer').text(producer);
            $('#wares_country').text(country);
            $('#wares_warecategory').text(warecategory);
            $('#wares_shop').text(shop);
            $('#wares_pricecategory').text(pricecategory);
            $('#wares_nettoweight').text(nettoweight);
            $('#wares_bruttoweight').text(bruttoweight);
            $('#wares_validbefore').text(validbefore);
            $('#wares_staff').text(staff);
            $('#wares_conditions').text(conditions);
            $('#wares_protein').text(protein);
            $('#wares_fat').text(fat);
            $('#wares_carbonhydrates').text(carbonhydrates);
            $('#wares_energyvalue').text(energyvalue);

            $('#wares_wareimage').attr('src', '/Cash/' + shcode + '.png');

            var offs0 = $(element).offset();
            $('#WareMap').css("position", "absolute");
            $('#WareMap').css("left", '620px');
            $('#WareMap').css("top", offs0.top);

            //document.location = '#WareMap';
        };

        function SHCheck(element) {
            var element = $(element);
            var value = element.val().replace(' ', '');

            if (value == '') {
                $('#SHCodeError').text('Штрих код не заполнен');
                element.focus();
            }
            else {

                var re = /[^0-9\ ]/gi;
                if (re.test(value)) {
                    $('#SHCodeError').text('Неверный штрих код');
                    element.focus();
                }
                else {
                    $('#SHCodeError').text('');
                    element.val(value);
                }
            }

        };

        //        function uploadError(sender, args) {
        //            document.getElementById('lblStatus').innerText = args.get_fileName(),
        //             "<span style='color:red;'>" + args.get_errorMessage() + "</span>";
        //        };

        //        function StartUpload(sender, args) {
        //            document.getElementById('lblStatus').innerText = 'Uploading Started.';
        //        };

        //        function UploadComplete(sender, args) {
        //            var filename = args.get_fileName();
        //            var contentType = args.get_contentType();
        //            var text = "Size of " + filename + " is " + args.get_length() + " bytes";
        //            if (contentType.length > 0) {
        //                text += " and content type is '" + contentType + "'.";
        //            }
        //            document.getElementById('lblStatus').innerText = text;
        //            //$('#ImagePanel').hide();
        //        };  

    </script>
    <style type="text/css">
        #form1
        {
            height: 2376px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div style="height: 2341px">
                <%--<div style="visibility: visible;">
                    <asp:LinkButton ID="ImportBtn" runat="server" OnClick="ImportBtn_Click">Импорт</asp:LinkButton>
                    <asp:TextBox ID="ImportText" TextMode="MultiLine" runat="server" style="text-align:right;"></asp:TextBox>
                    <asp:GridView ID="GridView1" runat="server">
                    </asp:GridView>
                </div>--%>
                <div style="width: 210px; height: 90px; background: silver;" runat="server" id="LoginPanel">
                    <center>
                        <asp:DropDownList ID="LoginList" runat="server" Width="200" Height="20" AutoPostBack="true">
                        </asp:DropDownList>
                        <br />
                        <asp:TextBox ID="Password" runat="server" TextMode="Password" Width="195" Height="20"></asp:TextBox>
                        <asp:Button ID="Login" runat="server" Text="Login" Width="200" Height="30" OnClick="Login_Click" /><br />
                        <asp:Label ID="Login_Error" ForeColor="Red" runat="server" Width="100%"></asp:Label></center>
                </div>
                <div runat="server" id="Tools">
                    <asp:LinkButton ID="WaresBtn" runat="server" OnClick="WaresBtn_Click" Visible="false">Продукты</asp:LinkButton>
                    <asp:LinkButton ID="RecepBtn" runat="server" OnClick="RecepBtn_Click" Visible="false">Рецепты</asp:LinkButton>
                    <asp:Button ID="LogOut" runat="server" Text="LogOut" OnClick="Logout_Click" /><br />
                    <hr />
                    <div runat="server" id="WareTool">
                        <div id="AddWarePanel" style="position: absolute; left: 650px; top: 100px; background: #aaa;
                            border: solid 2px red;">
                            <asp:Panel ID="AddPanel" runat="server" Height="1520px" Width="461px">
                                <div style="border: solid 1px black; position: relative;">
                                    <center>
                                        <asp:LinkButton ID="ClearAddPanelBtn" runat="server" OnClick="ClearAddPanelBtn_Click">Очистить</asp:LinkButton></center>
                                </div>
                                <div style="border: solid 2px green; background: #292; position: relative;">
                                    <center>
                                        Обязательные для заполнения поля</center>
                                    <div style="border: solid 1px black; position: relative; height: 50px;">
                                        <div style="display: inline; width: 100px; position: absolute; left: 0px;">
                                            Штрихкод:
                                        </div>
                                        <div style="display: inline; position: absolute; right: 0px;">
                                            <asp:TextBox ID="SHCode" runat="server" Width="300px"></asp:TextBox>
                                            <br />
                                            <span id="SHCodeError" style="color: #FF0000;"></span>
                                        </div>
                                    </div>
                                    <div style="border: solid 1px black; position: relative; height: 50px;">
                                        <div style="display: inline; width: 100px; position: absolute; left: 0px;">
                                            Имя:
                                        </div>
                                        <div style="display: inline; position: absolute; right: 0px;">
                                            <asp:TextBox ID="NameBox" runat="server" Width="300px"></asp:TextBox>
                                            <br />
                                            <span id="Span2" style="color: #FF0000;"></span>
                                        </div>
                                    </div>
                                    <div style="border: solid 1px black; position: relative; height: 50px;">
                                        <div style="display: inline; width: 100px; position: absolute; left: 0px;">
                                            Магазин:
                                        </div>
                                        <div style="display: inline; position: absolute; right: 2px;">
                                            <asp:DropDownList ID="ShopList" runat="server" Height="26px" Width="300px" AutoPostBack="true"
                                                OnSelectedIndexChanged="ShopList_SelectedIndexChanged">
                                            </asp:DropDownList>
                                        </div>
                                        <asp:Panel ID="AddShop_Panel" runat="server" BorderStyle="Groove" Style="border: solid 2px red;
                                            background: orange; z-index: 2; position: absolute;" Visible="False">
                                            Наименование Магазинa:<br />
                                            <asp:TextBox ID="AddShop_Name" runat="server" Width="200px"></asp:TextBox><br />
                                            <asp:Button ID="Add_Shop_Add" runat="server" OnClick="Add_Shop_Add_Click" Text="Добавить" />
                                            <asp:Button ID="Add_Shop_Cancel" runat="server" OnClick="Add_Shop_Cancel_Click" Text="Отмена" />
                                        </asp:Panel>
                                    </div>
                                    <div style="border: solid 1px black; position: relative; height: 50px;">
                                        <div style="display: inline; width: 100px; position: absolute; left: 0px;">
                                            Цена:
                                        </div>
                                        <div style="display: inline; position: absolute; right: 0px;">
                                            <asp:TextBox ID="Price" runat="server" Width="300px"></asp:TextBox>
                                        </div>
                                    </div>
                                    <div style="border: solid 1px black; position: relative; height: 50px;">
                                        <div style="display: inline; width: 100px; position: absolute; left: 0px;">
                                            Ценовая категория:
                                        </div>
                                        <div style="display: inline; position: absolute; right: 0px;">
                                            <asp:DropDownList ID="PriceCategoryList" CssClass="Main" runat="server" Height="26px"
                                                Width="300px" AutoPostBack="true">
                                                <asp:ListItem Value="Эконом"></asp:ListItem>
                                                <asp:ListItem Value="Стандарт"></asp:ListItem>
                                                <asp:ListItem Value="Премиум"></asp:ListItem>
                                            </asp:DropDownList>
                                        </div>
                                    </div>
                                    <div style="border: solid 1px black; position: relative; height: 50px;">
                                        <div style="display: inline; width: 100px; position: absolute; left: 0px;">
                                            Категория товара:
                                        </div>
                                        <div style="display: inline; position: absolute; right: 0px;">
                                            <asp:DropDownList ID="WareCategoryList" runat="server" Height="26px" Width="300px"
                                                OnSelectedIndexChanged="WareCategoryList_SelectedIndexChanged" AutoPostBack="true">
                                            </asp:DropDownList>
                                        </div>
                                        <asp:Panel ID="AddWareCategoryPanel" runat="server" BorderStyle="Groove" Style="border: solid 2px red;
                                            background: orange; z-index: 2; position: absolute;" Visible="False">
                                            Наименование категории:<br />
                                            <asp:TextBox ID="AddWareCategory_Name" runat="server" Width="200px"></asp:TextBox><br />
                                            <asp:Button ID="AddWareCategory_Add" runat="server" OnClick="AddWareCategory_Add_Click"
                                                Text="Добавить" />
                                            <asp:Button ID="AddWareCategory_Cancel" runat="server" OnClick="AddWareCategory_Cancel_Click"
                                                Text="Отмена" />
                                        </asp:Panel>
                                    </div>
                                    <div runat="server" id="ChildCategoryPanel" style="border: solid 1px black; position: relative;
                                        height: 50px;" visible="false">
                                        <div style="display: inline; width: 100px; position: absolute; left: 0px;">
                                            Подкатегория товара:
                                        </div>
                                        <div style="display: inline; position: absolute; right: 0px;">
                                            <asp:DropDownList ID="WareChildCategoryList" runat="server" Height="26px" Width="300px"
                                                AutoPostBack="true" OnSelectedIndexChanged="WareChildCategoryList_SelectedIndexChanged">
                                            </asp:DropDownList>
                                        </div>
                                        <asp:Panel ID="AddWareChildCategoryPanel" runat="server" Style="border: solid 2px red;
                                            background: orange; z-index: 2; position: absolute;" Visible="False">
                                            Наименование подкатегории:<br />
                                            <asp:TextBox ID="AddWareChildCategory_Name" runat="server" Width="200px"></asp:TextBox><br />
                                            <asp:Button ID="AddWareChildCategory_Add" runat="server" OnClick="AddWareChildCategory_Add_Click"
                                                Text="Добавить" />
                                            <asp:Button ID="AddWareChildCategory_Cancel" runat="server" OnClick="AddWareChildCategory_Cancel_Click"
                                                Text="Отмена" />
                                        </asp:Panel>
                                    </div>
                                </div>
                                <div style="border: solid 2px green; background: #bb2; position: relative;">
                                    <center>
                                        Дополнительные поля</center>
                                    <div style="border: solid 1px black; position: relative; height: 50px;">
                                        <div style="display: inline; width: 100px; position: absolute; left: 0px;">
                                            Артикул:
                                        </div>
                                        <div style="display: inline; position: absolute; right: 0px;">
                                            <asp:TextBox ID="Article" runat="server" Width="300px"></asp:TextBox>
                                            <br />
                                            <span id="Span1" style="color: #FF0000;"></span>
                                        </div>
                                    </div>
                                    <div style="border: solid 1px black; position: relative; height: 80px;">
                                        <div style="display: inline; width: 100px; position: absolute; left: 0px;">
                                            Краткое описание:
                                        </div>
                                        <div style="display: inline; position: absolute; right: 0px;">
                                            <asp:TextBox ID="ShortDesc" TextMode="MultiLine" runat="server" Width="300px" Height="63px"></asp:TextBox>
                                        </div>
                                    </div>
                                    <div style="border: solid 1px black; position: relative; height: 120px;">
                                        <div style="display: inline; width: 100px; position: absolute; left: 0px;">
                                            Полное описание:
                                        </div>
                                        <div style="display: inline; position: absolute; right: 0px;">
                                            <asp:TextBox ID="FullDesc" TextMode="MultiLine" runat="server" Width="300px" Height="106px"></asp:TextBox>
                                        </div>
                                    </div>
                                    <div style="border: solid 1px black; height: 20px;">
                                        Скрытый:
                                        <asp:CheckBox ID="IsHidden" runat="server" />
                                        Весовой:
                                        <asp:CheckBox ID="IsPiece" runat="server" />
                                    </div>
                                    <div style="border: solid 1px black; position: relative; height: 50px;">
                                        <div style="display: inline; width: 100px; position: absolute; left: 0px;">
                                            Изготовитель:
                                        </div>
                                        <div style="display: inline; position: absolute; right: 0px;">
                                            <asp:DropDownList ID="ProducersList" runat="server" Height="26px" Width="300px" AutoPostBack="true"
                                                OnSelectedIndexChanged="ProducersList_SelectedIndexChanged">
                                            </asp:DropDownList>
                                        </div>
                                        <asp:Panel ID="AddProducerPanel" runat="server" BorderStyle="Groove" Style="border: solid 2px red;
                                            background: orange; z-index: 2; position: absolute;" Visible="False">
                                            Наименование производителя:<br />
                                            <asp:TextBox ID="AddProducer_ProducerName" runat="server" Width="300px"></asp:TextBox><br />
                                            <asp:Button ID="AddProducer_Add" runat="server" OnClick="AddProducer_Add_Click" Text="Добавить" />
                                            <asp:Button ID="AddProducer_Cancel" runat="server" OnClick="AddProducer_Cancel_Click"
                                                Text="Отмена" />
                                        </asp:Panel>
                                    </div>
                                    <div style="border: solid 1px black; position: relative; height: 50px;">
                                        <div style="display: inline; width: 100px; position: absolute; left: 0px;">
                                            Страна:
                                        </div>
                                        <div style="display: inline; position: absolute; right: 0px;">
                                            <asp:DropDownList ID="CountryList" runat="server" Height="26px" Width="300px" AutoPostBack="true"
                                                OnSelectedIndexChanged="CountryList_SelectedIndexChanged">
                                            </asp:DropDownList>
                                        </div>
                                        <asp:Panel ID="AddCountryPanel" runat="server" Visible="False" Style="border: solid 2px red;
                                            z-index: 2; position: absolute; background: orange;" BorderStyle="Groove">
                                            Наименование страны:<br />
                                            <asp:TextBox ID="AddCountry_CountryName" runat="server" Width="300px"></asp:TextBox><br />
                                            <asp:Button ID="AddCountry_Add" runat="server" OnClick="AddCountry_Add_Click" Text="Добавить" />
                                            <asp:Button ID="AddCountry_Cancel" runat="server" OnClick="AddCountry_Cancel_Click"
                                                Text="Отмена" />
                                        </asp:Panel>
                                    </div>
                                    <div style="border: solid 1px black; position: relative; height: 50px;">
                                        <div style="display: inline; width: 100px; position: absolute; left: 0px;">
                                            Цена со скидкой:
                                        </div>
                                        <div style="display: inline; position: absolute; right: 0px;">
                                            <asp:TextBox ID="PriceRed" runat="server" Width="300px"></asp:TextBox>
                                        </div>
                                    </div>
                                    <div style="border: solid 1px black; position: relative; height: 50px;">
                                        <div style="display: inline; width: 100px; position: absolute; left: 0px;">
                                            Масса нетто:
                                        </div>
                                        <div style="display: inline; position: absolute; right: 0px;">
                                            <asp:TextBox ID="NettoWeight" runat="server" Width="300px"></asp:TextBox>
                                        </div>
                                    </div>
                                    <div style="border: solid 1px black; position: relative; height: 50px;">
                                        <div style="display: inline; width: 100px; position: absolute; left: 0px;">
                                            Масса брутто:
                                        </div>
                                        <div style="display: inline; position: absolute; right: 0px;">
                                            <asp:TextBox ID="BruttoWeight" runat="server" Width="300px"></asp:TextBox>
                                        </div>
                                    </div>
                                    <div style="border: solid 1px black; position: relative; height: 50px;">
                                        <div style="display: inline; width: 100px; position: absolute; left: 0px;">
                                            Срок годности:
                                        </div>
                                        <div style="display: inline; position: absolute; right: 0px;">
                                            <asp:TextBox ID="ValidBefore" runat="server" Width="300px"></asp:TextBox>
                                        </div>
                                    </div>
                                    <div style="border: solid 1px black; position: relative; height: 50px;">
                                        <div style="display: inline; width: 100px; position: absolute; left: 0px;">
                                            Условия хранения:
                                        </div>
                                        <div style="display: inline; position: absolute; right: 0px;">
                                            <asp:TextBox ID="Conditions" runat="server" Width="300px"></asp:TextBox>
                                        </div>
                                    </div>
                                    <div style="border: solid 1px black; position: relative; height: 50px;">
                                        <div style="display: inline; width: 100px; position: absolute; left: 0px;">
                                            Белки:
                                        </div>
                                        <div style="display: inline; position: absolute; right: 0px;">
                                            <asp:TextBox ID="Protein" runat="server" Width="300px"></asp:TextBox>
                                        </div>
                                    </div>
                                    <div style="border: solid 1px black; position: relative; height: 50px;">
                                        <div style="display: inline; width: 100px; position: absolute; left: 0px;">
                                            Жиры:
                                        </div>
                                        <div style="display: inline; position: absolute; right: 0px;">
                                            <asp:TextBox ID="Fat" runat="server" Width="300px"></asp:TextBox>
                                        </div>
                                    </div>
                                    <div style="border: solid 1px black; position: relative; height: 50px;">
                                        <div style="display: inline; width: 100px; position: absolute; left: 0px;">
                                            Углеводы:
                                        </div>
                                        <div style="display: inline; position: absolute; right: 0px;">
                                            <asp:TextBox ID="Carbonhydrates" runat="server" Width="300px"></asp:TextBox>
                                        </div>
                                    </div>
                                    <div style="border: solid 1px black; position: relative; height: 50px;">
                                        <div style="display: inline; width: 100px; position: absolute; left: 0px;">
                                            Энергитическая ценность:
                                        </div>
                                        <div style="display: inline; position: absolute; right: 0px;">
                                            <asp:TextBox ID="EnergyValue" runat="server" Width="300px"></asp:TextBox>
                                        </div>
                                    </div>
                                    <div style="border: solid 1px black; position: relative; height: 180px;">
                                        <div style="display: inline; width: 100px; position: absolute; left: 0px;">
                                            Состав:
                                        </div>
                                        <div style="display: inline; position: absolute; right: 0px;">
                                            <asp:ListBox ID="StaffList" runat="server" AutoPostBack="true" Width="300px"></asp:ListBox>
                                            <br />
                                            <asp:DropDownList ID="IngredientsList" runat="server" Height="26px" Width="300px"
                                                AutoPostBack="true" OnSelectedIndexChanged="IngredientsList_SelectedIndexChanged">
                                            </asp:DropDownList>
                                            <br />
                                            <asp:LinkButton ID="PushIngredient" runat="server" OnClick="PushIngredient_Click">Добавить ингредиент в состав...</asp:LinkButton>
                                            <br />
                                            <asp:LinkButton ID="PopIngredient" runat="server" OnClick="PopIngredient_Click">Удалить ингредиент из состава...</asp:LinkButton>
                                        </div>
                                        <asp:Panel ID="AddIngredientPanel" BorderStyle="Groove" runat="server" Style="border: solid 2px red;
                                            z-index: 2; position: absolute; width: 450px; background: orange;" Visible="false">
                                            <div style="border: solid 1px black; position: relative; height: 46px;">
                                                <div style="display: inline; width: 100px; position: absolute; left: 0px;">
                                                    Наименование Ингредиента:
                                                </div>
                                                <div style="display: inline; position: absolute; right: 0px;">
                                                    <asp:TextBox ID="AddIngredient_Name" runat="server" Width="290px"></asp:TextBox>
                                                </div>
                                            </div>
                                            <div style="border: solid 1px black; position: relative; height: 46px;">
                                                <div style="display: inline; width: 100px; position: absolute; left: 0px;">
                                                    Тип ингредиента:
                                                </div>
                                                <div style="display: inline; position: absolute; right: 0px;">
                                                    <asp:DropDownList ID="AddIngredient_TypeList" runat="server" Height="26px" Width="300px"
                                                        AutoPostBack="true" OnSelectedIndexChanged="AddIngredient_TypeList_SelectedIndexChanged">
                                                    </asp:DropDownList>
                                                </div>
                                                <asp:Panel ID="AddIngredient_Type_ADDPanel" BorderStyle="Groove" runat="server" Visible="False"
                                                    Style="border: solid 2px red; z-index: 3; position: absolute; background: brown;">
                                                    Тип:<br />
                                                    <asp:TextBox ID="AddIngredient_Type_ADD_Name" runat="server" Width="300px"></asp:TextBox><br />
                                                    <asp:Button ID="AddIngredient_Type_ADD_Add" runat="server" OnClick="AddIngredient_Type_ADD_Add_Click"
                                                        Text="Добавить" />
                                                    <asp:Button ID="AddIngredient_Type_ADD_Cancel" runat="server" OnClick="AddIngredient_Type_ADD_Cancel_Click"
                                                        Text="Отмена" />
                                                </asp:Panel>
                                            </div>
                                            <div style="border: solid 1px black; position: relative; height: 46px;">
                                                <div style="display: inline; width: 100px; position: absolute; left: 0px;">
                                                    Значение светофора:
                                                </div>
                                                <div style="display: inline; position: absolute; right: 0px;">
                                                    <asp:TextBox ID="AddIngredient_LightValue" runat="server" Width="290px"></asp:TextBox>
                                                </div>
                                            </div>
                                            <div style="border: solid 1px black; position: relative; height: 105px;">
                                                <div style="display: inline; width: 100px; position: absolute; left: 0px;">
                                                    Описание:
                                                </div>
                                                <div style="display: inline; position: absolute; right: 0px;">
                                                    <asp:TextBox ID="AddIngredient_Description" TextMode="MultiLine" runat="server" Width="290px"
                                                        Height="90"></asp:TextBox>
                                                </div>
                                            </div>
                                            <div style="border: solid 1px black; position: relative; height: 105px;">
                                                <div style="display: inline; width: 100px; position: absolute; left: 0px;">
                                                    Комментарий:
                                                </div>
                                                <div style="display: inline; position: absolute; right: 0px;">
                                                    <asp:TextBox ID="AddIngredient_Comment" TextMode="MultiLine" Height="90" runat="server"
                                                        Width="290px"></asp:TextBox>
                                                </div>
                                            </div>
                                            <asp:Button ID="AddIngredient_Add" runat="server" OnClick="AddIngredient_Add_Click"
                                                Text="Добавить" />
                                            <asp:Button ID="AddIngredient_Cancel" runat="server" OnClick="AddIngredient_Cancel_Click"
                                                Text="Отменить" />
                                        </asp:Panel>
                                    </div>
                                </div>
                                <asp:Label ID="ErrorMarker" runat="server" Visible="false" Text="Внимание! Некорректно заполнены следующие поля:"></asp:Label>
                                <asp:Label ID="ErrorList" runat="server"></asp:Label>
                                <asp:Button ID="AddWare" runat="server" Visible="false" OnClick="AddWare_Click" Text="Добавить товар" />
                                <asp:Button ID="SaveChanged" runat="server" Visible="false" Text="Сохранить изменения"
                                    OnClick="SaveChanged_Click" />
                                <asp:Button ID="SaveWareAs" runat="server" Visible="false" Text="Сохранить как новый товар"
                                    OnClick="AddWare_Click" />
                            </asp:Panel>
                        </div>
                        <div style="position: absolute; left: 10px; top: 100px; width: 600px;">
                            <div style="border: solid 1px black; position: relative; height: 30px;">
                                <div style="display: inline; width: 100px; position: absolute; left: 2px; top: 2px;">
                                    <asp:DropDownList ID="WareTable_ShopsFilter" runat="server" Height="26px" Width="280px"
                                        AutoPostBack="true" OnSelectedIndexChanged="LoadTable_WithFilters">
                                    </asp:DropDownList>
                                </div>
                                <div style="display: inline; position: absolute; right: 2px; top: 2px;">
                                    <asp:DropDownList ID="WareTable_CategoriesFilter" runat="server" Height="26px" Width="280px"
                                        AutoPostBack="true" OnSelectedIndexChanged="LoadTable_WithFilters">
                                    </asp:DropDownList>
                                </div>
                            </div>
                        </div>
                        <div style="position: absolute; left: 10px; top: 150px; width: 600px;">
                            <asp:Panel ID="WaresTable" runat="server" Width="600px">
                               
                                <asp:Repeater ID="WaresRepeater" runat="server">
                                    <HeaderTemplate>
                                        <table border="0" cellspacing="1px" style="background: red; width: 600px; table-layout: fixed;
                                            word-wrap: break-word;">
                                            <thead style="background: #999; font-weight: bold;" align="center">
                                                <td style="width: 120px;">
                                                    Штрихкод
                                                </td>
                                                <td>
                                                    Имя
                                                </td>
                                                <td style="width: 70px;">
                                                    Магазин
                                                </td>
                                                <td style="width: 70px;">
                                                    Цена
                                                </td>
                                                <td style="width: 70px;">
                                                    Цена со скидкой
                                                </td>
                                                <td style="width: 75px;">
                                                </td>
                                            </thead>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <tr style="background: silver;" wareid='<%# Eval("WaresID") %>' ispiece='<%#Eval("IsPiece") %>'
                                            where="wares" wareattr_warename='<%#Eval("WareName") %>' wareattr_shortdesc='<%#Eval("ShortDesc") %>'
                                            wareattr_fulldesc='<%#Eval("FullDesc") %>' wareattr_shcode='<%#Eval("SHCode") %>'
                                            wareattr_pricemain='<%#Eval("PriceMain") %>' wareattr_pricecategory='<%#Eval("PriceCategory") %>'
                                            wareattr_producer='<%#Eval("Producer") %>' wareattr_country='<%#Eval("Country") %>'
                                            wareattr_warecategory='<%#Eval("WareCategory") %>' wareattr_counter='<%#Eval("Counter") %>'
                                            wareattr_rating='<%#Eval("Rating") %>' wareattr_shopid='<%#Eval("ShopID") %>'
                                            wareattr_shop='<%#Eval("Shop") %>' wareattr_article='<%#Eval("Article") %>' wareattr_liveid='<%#Eval("LiveID") %>'
                                            wareattr_pricered='<%#Eval("PriceRed") %>' wareattr_groupid='<%#Eval("GroupID") %>'
                                            wareattr_nettoweight='<%#Eval("NettoWeight") %>' wareattr_bruttoweight='<%#Eval("BruttoWeight") %>'
                                            wareattr_recipe='<%#Eval("Recipe") %>' wareattr_staff='<%#Eval("Staff") %>' wareattr_stafflistguid='<%#Eval("StaffListGuid") %>'
                                            wareattr_validbefore='<%#Eval("ValidBefore") %>' wareattr_conditions='<%#Eval("Conditions") %>'
                                            wareattr_protein='<%#Eval("Protein") %>' wareattr_fat='<%#Eval("Fat") %>' wareattr_carbonhydrates='<%#Eval("Carbonhydrates") %>'
                                            wareattr_energyvalue='<%#Eval("EnergyValue") %>' wareattr_lightvalue='<%#Eval("LightValue") %>'
                                            wareattr_dateupdateprice='<%#Eval("DateUpdatePrice") %>'>
                                            <td>
                                                <%# Eval("SHCode")%>
                                            </td>
                                            <td>
                                                <%# Eval("WareName") %>
                                            </td>
                                            <td>
                                                <%# Eval("Shop") %>
                                            </td>
                                            <td>
                                                <%# Eval("PriceMain") %>
                                            </td>
                                            <td>
                                                <%# Eval("PriceRed") %>
                                            </td>
                                            <td style="width: 100px;">
                                                <asp:CheckBox ID="CheckBox1" wareid='<%# Eval("WaresID")%>' Checked='<%# Eval("IsHidden")%>'
                                                    AutoPostBack="true" OnCheckedChanged="IdHiddenChanged" Text="Скрыт" runat="server" />
                                                <br />
                                                <asp:CheckBox ID="CheckBox2" wareid='<%# Eval("WaresID")%>' Checked='<%# Eval("IsDeleted")%>'
                                                    AutoPostBack="true" OnCheckedChanged="IdDeletedChanged" Text="Удален" runat="server" />
                                            </td>
                                        </tr>
                                    </ItemTemplate>
                                    <FooterTemplate>
                                        </table>
                                    </FooterTemplate>
                                </asp:Repeater>
                                 <center>
                                        <asp:Repeater ID="NavigateRepeater" runat="server">
                                            <ItemTemplate>
                                                <asp:LinkButton ID="NavigatorLink" runat="server" OnClick="NavigatorClick" Text='  <%# Eval("PageNumber") %>  '></asp:LinkButton>
                                            </ItemTemplate>
                                        </asp:Repeater>
                                </center>
                            </asp:Panel>
                        </div>
                        <div id="WareMap" style="background: red; visibility: hidden; width: 500px;">
                            <table border="0" cellspacing="1px" style="background: black; width: 500px;">
                                <tr style="background: #bbb;">
                                    <td>
                                        <center>
                                            <span id="wares_warename"></span>
                                        </center>
                                    </td>
                                    <td>
                                        <div style="width: 100px; height: 100%; background: orange;">
                                            <center>
                                                <asp:LinkButton ID="ChangeLinkButton" runat="server" OnClick="LB_Change_Click">Изменить</asp:LinkButton></center>
                                        </div>
                                    </td>
                                    <td align="right">
                                        <span style="width: 30px; height: 100%; background: red;" id="closeWareMap">X</span>
                                    </td>
                                </tr>
                                <tr style="background: #bbb;">
                                    <td style="width: 180px">
                                        Штрихкод
                                    </td>
                                    <td style="width: 100px">
                                        <span id="wares_shcode"></span>
                                    </td>
                                    <td rowspan="7">
                                        <center>
                                            <img id="wares_wareimage" width="150px" height="150px" /></center>
                                    </td>
                                </tr>
                                <tr style="background: #ccc;">
                                    <td style="width: 180px">
                                        Артикул
                                    </td>
                                    <td style="width: 100px">
                                        <span id="wares_article"></span>
                                    </td>
                                </tr>
                                <tr style="background: #bbb;">
                                    <td style="width: 180px">
                                        Производитель
                                    </td>
                                    <td style="width: 100px">
                                        <span id="wares_producer"></span>
                                    </td>
                                </tr>
                                <tr style="background: #ccc;">
                                    <td style="width: 180px">
                                        Страна
                                    </td>
                                    <td style="width: 100px">
                                        <span id="wares_country"></span>
                                    </td>
                                </tr>
                                <tr style="background: #ccc;">
                                    <td style="width: 180px">
                                        Магазин
                                    </td>
                                    <td style="width: 100px">
                                        <span id="wares_shop"></span>
                                    </td>
                                </tr>
                                <tr style="background: #bbb;">
                                    <td style="width: 180px">
                                        Цена
                                    </td>
                                    <td style="width: 100px">
                                        <span id="wares_pricemain"></span>
                                    </td>
                                </tr>
                                <tr style="background: #ccc;">
                                    <td style="width: 180px">
                                        Цена со скидкой
                                    </td>
                                    <td style="width: 100px">
                                        <span id="wares_pricered"></span>
                                    </td>
                                </tr>
                                <tr style="background: #bbb;">
                                    <td style="width: 180px">
                                        Краткое описание
                                    </td>
                                    <td colspan="2" style="width: 300px">
                                        <span id="wares_shortdesc"></span>
                                    </td>
                                </tr>
                                <tr style="background: #ccc;">
                                    <td style="width: 180px">
                                        Полное описание
                                    </td>
                                    <td colspan="2" style="width: 300px">
                                        <span id="wares_fulldesc"></span>
                                    </td>
                                </tr>
                                <tr style="background: #bbb;">
                                    <td style="width: 180px">
                                        Ценовая категория
                                    </td>
                                    <td colspan="2" style="width: 300px">
                                        <span id="wares_pricecategory"></span>
                                    </td>
                                </tr>
                                <tr style="background: #ccc;">
                                    <td style="width: 180px">
                                        Категория товара
                                    </td>
                                    <td colspan="2" style="width: 300px">
                                        <span id="wares_warecategory"></span>
                                    </td>
                                </tr>
                                <tr style="background: #bbb;">
                                    <td style="width: 180px">
                                        Нетто
                                    </td>
                                    <td colspan="2" style="width: 300px">
                                        <span id="wares_nettoweight"></span>
                                    </td>
                                </tr>
                                <tr style="background: #ccc;">
                                    <td style="width: 180px">
                                        Брутто
                                    </td>
                                    <td colspan="2" style="width: 300px">
                                        <span id="wares_bruttoweight"></span>
                                    </td>
                                </tr>
                                <tr style="background: #bbb;">
                                    <td style="width: 180px">
                                        Срок годности
                                    </td>
                                    <td colspan="2" style="width: 300px">
                                        <span id="wares_validbefore"></span>
                                    </td>
                                </tr>
                                <tr style="background: #ccc;">
                                    <td style="width: 180px">
                                        Условия хранения
                                    </td>
                                    <td colspan="2" style="width: 300px">
                                        <span id="wares_conditions"></span>
                                    </td>
                                </tr>
                                <tr style="background: #bbb;">
                                    <td style="width: 180px">
                                        Белки
                                    </td>
                                    <td colspan="2" style="width: 300px">
                                        <span id="wares_protein"></span>
                                    </td>
                                </tr>
                                <tr style="background: #ccc;">
                                    <td style="width: 180px">
                                        Жиры
                                    </td>
                                    <td colspan="2" style="width: 300px">
                                        <span id="wares_fat"></span>
                                    </td>
                                </tr>
                                <tr style="background: #bbb;">
                                    <td style="width: 180px">
                                        Углеводы
                                    </td>
                                    <td colspan="2" style="width: 300px">
                                        <span id="wares_carbonhydrates"></span>
                                    </td>
                                </tr>
                                <tr style="background: #ccc;">
                                    <td style="width: 180px">
                                        Енергетическая ценность
                                    </td>
                                    <td colspan="2" style="width: 300px">
                                        <span id="wares_energyvalue"></span>
                                    </td>
                                </tr>
                                <tr style="background: #bbb;">
                                    <td style="width: 180px">
                                        Состав
                                    </td>
                                    <td colspan="2" style="width: 300px">
                                        <span id="wares_staff"></span>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdateProgress ID="UpdateProgress1" AssociatedUpdatePanelID="UpdatePanel1" runat="server">
        <ProgressTemplate>
            <div style="position: fixed; left: 0px; top: 0px; right: 0px; bottom: 0px; background: #bbb;
                opacity: 0.5;">
            </div>
            <div style="position: fixed; left: 500px; top: 200px; width: 300px; height: 200px;
                background: #f00; border: solid 1px  black;">
                <center>
                    <h1>
                        Загрузка...</h1>
                </center>
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <div id="ImageDiv" style="position: fixed; left: 400px; top: 100px; width: 300px;
        background: #aaa; border: solid 1px  black;">
        <asp:Panel ID="ImagePanel" runat="server">
            <center>
                <span style="background: red;" id="CloseImagePanel">Close</span><br />
                <asp:FileUpload ID="FileUpload1" Width="280px" runat="server" /><br />
                <asp:LinkButton ID="UploadImageBtn" runat="server" OnClick="UploadImage">Upload</asp:LinkButton><br />
                <asp:Image ID="Image1" Width="150px" Height="150px" runat="server" /><br />
                <asp:Label runat="server" ID="NoImageLabel" Text="Нет изображения" ForeColor="Red"></asp:Label>
            </center>
        </asp:Panel>
    </div>
    </form>
</body>
</html>
